package com.qidian.buy.controller;

import com.qidian.buy.service.ItemSearchService;
import com.qidian.buy.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 戴着假发的程序员
 * @company 起点编程
 * @date 2023/9/13 11:34
 */
@RestController
@RequestMapping("/item")
public class ItemSearchController {
    @Autowired
    private ItemSearchService itemSearchService;

    @GetMapping("/s")
    public QdResult s(@RequestParam(defaultValue = "") String keyword,@RequestParam(defaultValue = "1") int page,@RequestParam(defaultValue = "60") int limit){
        return itemSearchService.queryByPage(keyword,page,limit);
    }
}
